package com.Controller;

import com.Service.TbldpetService;
import com.Service.TblempService;
import com.Tool.Msg;
import com.domain.TblDept;
import com.domain.TblEmp;
import com.mapper.TblDeptMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
@Controller
public class TblDeptController {
    @Autowired
    private TbldpetService tbldpetService;

    @RequestMapping("selecttbldept")
    public String select(){
        List<TblDept> tblEmpList = tbldpetService.select();
        for (TblDept tblDept:tblEmpList
        ) {
            System.out.println(tblDept);
        }
        return "success";
    }

    @RequestMapping("depts")
    @ResponseBody
    public Msg seldept(){
        List<TblDept> select = tbldpetService.select();
        return Msg.success().add("dept",select);
    }
}
